package com.yimi.yinhepda.views.kua_yue_spotGoods

import android.os.Bundle
import android.support.v7.widget.LinearLayoutManager
import com.yimi.yinhepda.R
import com.yimi.yinhepda.adapter.RecycleAdapter.KuaYueWaybillScanInfoAdapter
import com.pda.ym.base.BaseTitleActivity
import kotlinx.android.synthetic.main.activity_kuayue_scan_detail.*

/**
 * @author: lj
 * Date: 2020/4/18 17:14
 * Description:跨越运单扫描信息
 */
class KuaYueScanDetailActivity : BaseTitleActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        val detailEntity = KuaYueSpotGoodsActivity.mDetailEntity

        val adapter = KuaYueWaybillScanInfoAdapter(this, detailEntity.childNos)
        rv_list.layoutManager = LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false)
        rv_list.adapter = adapter

        tv_masterWaybill.setText(detailEntity.outsideNo)
        tv_jianNum.text = detailEntity.childNos.size.toString()
        tv_isScan.text = detailEntity.scanCount.toString()
        tv_noScan.text = (detailEntity.childNos.size - detailEntity.scanCount).toString()
        tv_realWeight.text = detailEntity.weight.toString()
        tv_chargedWeight.text = detailEntity.chargedWeight.toString()
        tv_volume.text = detailEntity.volume.toString()

        btn_back.setOnClickListener {
            finish()
        }
    }

    override fun getPageName(): String {
        return "跨越运单扫描信息"
    }

    override fun showBack(): Boolean {
        return false
    }

    override fun setBack() {
    }

    override fun setTitle(): String {
        return "运单扫描明细"
    }

    override fun setContentViewId(): Int {
        return R.layout.activity_kuayue_scan_detail
    }
}